package com.ideal.manage.esms.repository.monitor;

import com.ideal.manage.esms.bean.esms.EsmsUnitCell;
import com.ideal.manage.esms.repository.framework.BaseRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

/**
 * @author Allen
 */
public interface UnitCellDataRepository extends BaseRepository<EsmsUnitCell, String> {
    @Query("select e from EsmsUnitCell e where e.macid=?1 and e.cellName=?2 and e.dateTime >?3 and e.dateTime<?4 and e.projectIp=?5 order by e.dateTime asc ")
    List<EsmsUnitCell> findByCellData(String macid, String esname, Date start, Date end, String ip);

    @Query("select e from EsmsUnitCell e where e.cellName in ?1 and e.macid=?2 and e.dateTime >?3 and e.dateTime<?4 and e.projectIp=?5 order by e.dateTime asc ")
    List<EsmsUnitCell> findByGroupCellData(List<String> codes, String macid, Date start, Date end, String ip);

}
